package org.samith.web.servlet;

import javax.ejb.EJB;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.samith.scheduler.ISheduleRunner;

public class ShedulerServletContextListener implements ServletContextListener {
	
	@EJB
	ISheduleRunner sheduler;
	
	@Override
	public void contextDestroyed(ServletContextEvent arg) {
		sheduler.shutDownAllSchedulers();
	}
	
	@Override
	public void contextInitialized(ServletContextEvent arg) {
		sheduler.startAllShedulers();
	}

}
